<!-- List Address -->

<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
    <meta name="layout" content="main" />
    <title>Address List</title>
  </head>
  <body>
    <div class="body">
      <h1>Address List</h1>
      <g:if test="${flash.message}">
        <div class="message">${flash.message}</div>
      </g:if>
      <div class="list">
        <table>
          <thead>
            <tr>
              <g:sortableColumn property="line1" title="Line1" />
              <g:sortableColumn property="line2" title="Line2" />
              <g:sortableColumn property="suite" title="Suite" />
              <g:sortableColumn property="city" title="City" />
              <th>State</th>
              <th>&nbsp;</th>
            </tr>
          </thead>
          <tbody>
            <g:each in="${addressList}" status="i" var="address">
              <tr class="${(i % 2) == 0 ? 'odd' : 'even'}">
                <td>${fieldValue(bean:address, field:'line1')}</td>
                <td>${fieldValue(bean:address, field:'line2')}</td>
                <td>${fieldValue(bean:address, field:'suite')}</td>
                <td>${fieldValue(bean:address, field:'city')}</td>
                <td>${fieldValue(bean:address, field:'state')}</td>
                <td><g:link action="show" id="${address.id}">Show</g:link></td>
              </tr>
            </g:each>
          </tbody>
        </table>
      </div>
      <div class="paginateButtons">
        <g:paginate total="${total}" />
      </div>
    </div>
  </body>
</html>
